[build]
# do not rebuild stage0 packages once we're past that stage
test "$STAGE" = "0" || exit 0

mountpoint -q $R || rm -rf $R
mkdir -p $S $R

cd $R
mkdir -p boot bin dev etc home lib mnt proc root share srv src sys tmp var
mkdir -p var/log var/log/sshd var/log/crond var/log/dmesg
mkdir -p var/empty var/service var/tmp var/spool/cron/crontabs
ln -s . usr
ln -s bin sbin

chmod 1777 tmp
